<template>
	<view class="bg">
		<view class="teamTop bg pt-60 pl-30 size-26 gray-2 flex flex-start">
			<view class="">
				<view class="mb-40">
					我的团队
				</view>
				<view class="red">
					<text style="font-size:56rpx;margin-right:20rpx;">{{total_direct}}</text>人
				</view>
			</view>
			<view style="margin-left:180rpx;">
				<view class="mb-40">
					已认证人数
				</view>
				<view class="red ">
					<text style="font-size:56rpx;margin-right:20rpx;">{{total_valid_direct}}</text>人
				</view>
			</view>
		</view>
		<view class="plr-30 min100 pt-30" style="border-radius: 30rpx 30rpx 0 0;">
			<view class="white mb-30 size-30">
				团队成员
			</view>
			<empty v-if="list.length==0"></empty>
			<view v-else>
				<view class="flex flex-start plr-30 ptb-30 radius-16 size-24 gray-1 mb-30" style="background: #fff;"
					v-for="(item,index) in list" :key="index">
					<image :src="item.head_image" class="teamImg mr-20"></image>
					<view class="flex flex-between" style="width:85%;">
						<view class="">
							<view class="mb-30 gray size-26">
								{{item.phone.substr(0,3)+"****"+item.phone.substr(7)}}
							</view>
							<view>
								<image class="userAuth" v-if="item.is_auth==0" src="../../static/no_auth.png" mode="">
								</image>
								<image class="userAuth" v-if="item.is_auth==1" src="../../static/auth_2.png" mode="">
								</image>
							</view>
						</view>
						<view class="text-right">
							<view class="mb-30 ">
								注册时间
							</view>
							<view class="">
								{{item.create_time}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import empty from "../../components/empty.vue"
	export default {
		components: {
			empty
		},
		data() {
			return {
				total_direct: 0,
				total_valid_direct: 0,
				list: []
			}
		},
		onShow() {
			this.$http('api/user/userInfo').then(res => {
				this.total_direct = res.total_direct;
				this.total_valid_direct = res.total_valid_direct;
			})
			this.init();
		},
		methods: {
			init() {
				this.$http('api/user/team').then(res => {
					this.list = res;
				})
			}
		}
	}
</script>

<style lang='less' scoped>
	.teamTop {
		/* background: url(../../static/teamBg.png) 0 0 no-repeat; */
		background-size: 100%;
		width: 100%;
		height: 242rpx;
	}

	.teamImg {
		width: 90rpx;
		height: 90rpx;
		border-radius: 50%;
	}

	.userAuth {
		width: 130rpx;
		height: 40rpx;
	}
</style>
